
#include "simulation.h"


int testPiecePresente()
{
	return randBornes(0, 100) >= PROBA_PIECENONPRESENTE;
}


int testCartonPresent()
{
	return randBornes(0, 100) >= PROBA_CARTONNONPRESENT;
}


int testImprimanteOk()
{
	return randBornes(0, 100) >= PROBA_IMPRIMANTEPANNE;
}


int testPalettePresente()
{
	return randBornes(0, 100) >= PROBA_PALETTENONPRESENTE;
}


int lireDimensionPiece()
{
	return randBornes(9, 16);
}


int randBornes(int a, int b)
{
    return rand() % (b - a + 1) + a;
}


void retirerCartonTapis()
{
	msgQReceive(balCarton, NULL, 0, WAIT_FOREVER);
}


void amenerPiece()
{
#ifndef TESTING
	taskDelay(PERIODE);
#else
	taskDelay(0);
#endif
}


void amenerCarton()
{
#ifndef TESTING
	taskDelay(PERIODE);
#else
	taskDelay(0);
#endif
}


void imprimerEtiquette(MsgCarton * carton)
{
#ifndef TESTING
	taskDelay(PERIODE);
#else
	taskDelay(0);
#endif
}


void apposerFilmPlastique()
{
#ifndef TESTING
	taskDelay(PERIODE);
#else
	taskDelay(0);
#endif
}

void transfererTerminalMobile(MsgOrdreExpe * ordreExpe)
{
}

void expedierCommande()
{
#ifndef TESTING
	taskDelay(200);
#else
	taskDelay(0);
#endif
}
